
#include <pthread.h>
#include "Mutex.h"
#include "Cond.h"

Cond::Cond () {
 pthread_cond_init (&condInfo, NULL);
}

void Cond::setMutex (Mutex& mu) {
 mutexInfo = mu.c_mutex();
}

void Cond::broadcast () {
 pthread_cond_broadcast (&condInfo);
}

void Cond::signal () {
 pthread_cond_signal (&condInfo);
}

void Cond::wait () {
 pthread_cond_wait (&condInfo, mutexInfo);
}

Cond::~Cond() {
 pthread_cond_destroy (&condInfo);
}

